cmake_minimum_required(VERSION 3.20)

set(CMAKE_C_STANDARD 99)

set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set(CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
add_library(wsock32 SHARED wsock32.def wsock32.rc wsock32.c enum_protocols_template.c enum_protocols_template_impl.h socktable.c)
set_target_properties(wsock32 PROPERTIES PREFIX "")
set_target_properties(wsock32 PROPERTIES LIBRARY_OUTPUT_NAME wsock32.dll)
target_link_libraries(wsock32 mswsock ws2_32)